home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group99a.txt
/
000145_icon-group-sender _Wed Jun 23 09:06:42 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
1KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA10826
for icon-group-addresses; Wed, 23 Jun 1999 09:06:30 -0700 (MST)
Message-Id: <199906231606.JAA10826@baskerville.CS.Arizona.EDU>
To: icon-group@optima.CS.Arizona.EDU
Date: 23 Jun 1999 10:17:28 GMT
From: eddie@holyrood.ed.ac.uk (Eddie Corns)
Subject: Re: Assertions in Icon
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Kostas Oikonomou <oikonomou@att.com> writes:
>Hello,
>Does anyone have a suggestion about how to implement a procedure "assert",
>which, when called with an expression "e" as argument, implements
> e | stop("Assertion on line ", &line, " failed!")
>Here &line should be the line on which assert(e) appears.
>Thanks.
> Kostas Oikonomou
>
Easiest soln which occurs to me is to use a preprocessor to convert
assert(e)
to the form you want. Either inline it or replace with do_assert(e,nnn) where
nnn is the line no.
I usually use symobolic tags like
assert(e,"RDF4")
then use a file that maps tags to meaningful messages like "Read failed in
Open Directory". (Well to be truthful, most of the time I just print the tag
and check it in the source).
Eddie